<?php

include_once("../../config.php");
include_once("model/common.php");


//$openid               = $_REQUEST['openid'];
$refund_apply         = $_REQUEST['nid'];


//todo 查看出需要发送的模板消息，有的都发吧。


//发送消息模板的地址
$url = "https://milkorder.dagger.enpingshi.com/api/wechat_mp/send_message_model.php";

$employee=select_lines_all_items($table_Prefix."employee","",
    "quanxian like '%admin%' and openid is not null","9990");


foreach ($employee as $key => $value)
{




echo "<br/><br/><br/><br/><br/><br/><br/><br/>当前用户".$openid."";

$post_data = array(
    "touser"=>$value['openid'], //推送给谁,openid
    //"touser"=>'oQ6mt577lkGnS9VGtYwc9jUW3XVI', //推送给工作号
    "template_id"=>"1DqGzhxUzmy-qr6FXIbYjYoRAF8WAQV9t2WuKzn0B5w", //微信后台的模板信息id
    "url"=>"https://milkorder.dagger.enpingshi.com/front/milkorder/view/refund_apply.php?nid=".$refund_apply,
    "data"=> array(
        "first" => array(
            "value"=>"退款申请",
            "color"=>"#173177"
        ),
        "keyword1"=>array(
            "value"=>date("Y-m-d"),//时间
            "color"=>"#173177"
        ),

        "keyword2"=>array(
            "value"=>"有退款申请，请登录系统审核",
            "color"=>"#173177"
        ),
        "remark"=> array(
            "value"=>"请点击本通知跳转到【天宫系统】系统页面查看详情；",
            "color"=>"#173177"
        ),
    )
);

$sql_data = serialize($post_data);
$data['content'] = $sql_data;
$re_back = send_wx_sms($url , $data);
$re_back_arr = json_decode($re_back, true);

echo $re_back;

}








?>

